const express = require('express');
let router = express.Router();
router.get('/test', function (req, res) {
    res.send({
        code:0,
        msg:"查询成功",
    });
});
router.post('/fileSync', function (req, res) {
    const fileSync=require("../src/file/copyFolder.js");
    fileSync(req.body).then(resPromise=>{
        res.send({
            code:0,
            msg:"文件同步成功",
        });
    }).catch(resPromise=>{
        res.send({
            code:1,
            msg:"文件同步失败",
        });
    });
});
router.post('/build', function (req, res) {
    const projectBuild=require("../src/build/build.js");
    projectBuild(req.body).then(resPromise=>{
        res.send({
            code:0,
            msg:"打包成功",
        });
    }).catch(resPromise=>{
        res.send({
            code:1,
            msg:"打包失败",
        });
    });
});
module.exports=router;